import strutils, sequtils, strformat

const things = [
  "twelve Drummers Drumming",
  "eleven Pipers Piping",
  "ten Lords-a-Leaping", 
  "nine Ladies Dancing", 
  "eight Maids-a-Milking", 
  "seven Swans-a-Swimming", 
  "six Geese-a-Laying", 
  "five Gold Rings", 
  "four Calling Birds", 
  "three French Hens", 
  "two Turtle Doves", 
  "and a Partridge",
  ]
const nth = ["first", "second", "third", "fourth", "fifth", "sixth",
  "seventh","eighth","ninth","tenth", "eleventh", "twelfth"]

proc recite*(index: int): string =
  let thing = if index > 1: things[12 - index..^1].join(", ") else: "a Partridge"
  &"On the {nth[index - 1]} day of Christmas my true love gave to me: {thing} in a Pear Tree."

proc recite*(start: int, finish: int): string =
  toSeq(start..finish).map(recite).join("\n\n")